From 93da65bf18b7e7db7e6563a7702072ffc8be7653 Mon Sep 17 00:00:00 2001 From: robertlipe Date: Mon, 17 Feb 2014 01:58:24 +0000 Subject: [PATCH] Remove static buffer (that would never be overflowed) in KML geocache writer. git-svn-id: http://gpsbabel.googlecode.com/svn/trunk@4747 f51c46e8-681c-474f-0cfe-069cfd0219fb --- gpsbabel/gui/gmapdlg.cc | 2 +- gpsbabel/kml.cc | 8 ++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/gpsbabel/gui/gmapdlg.cc b/gpsbabel/gui/gmapdlg.cc index 1c9a0c7b8..cb2bfcfe4 100644 --- a/gpsbabel/gui/gmapdlg.cc +++ b/gpsbabel/gui/gmapdlg.cc @@ -145,6 +145,7 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd lay->addWidget(mapWidget_); model_ = new QStandardItemModel(this); + menuIndex_ = -1; // Actually set for real in showContextMenu(). wptItem_ = new StandardItem(tr("Waypoints")); wptItem_->setCheckable(true); @@ -211,7 +212,6 @@ GMapDialog::GMapDialog(QWidget *parent, const QString &gpxFileName, QPlainTextEd connect(ui_.copyButton, SIGNAL(clicked()), this, SLOT(copyButtonClickedX())); ui_.copyButton->hide(); // Hide for now, not working - } //------------------------------------------------------------------------- diff --git a/gpsbabel/kml.cc b/gpsbabel/kml.cc index bcbfdfde3..12226cb7f 100644 --- a/gpsbabel/kml.cc +++ b/gpsbabel/kml.cc @@ -1395,8 +1395,6 @@ static void kml_write_cdata_element(const QString& name, const QString& value) static void kml_geocache_pr(const Waypoint* waypointp) { char* is; - char date_placed[100]; // Always long engough for a date. - const char* issues = ""; writer->writeStartElement("Placemark"); @@ -1412,11 +1410,9 @@ static void kml_geocache_pr(const Waypoint* waypointp) // Timestamp kml_output_timestamp(waypointp); + QString date_placed; if (waypointp->GetCreationTime().isValid()) { - strcpy(date_placed, - qPrintable(waypointp->GetCreationTime().toString("dd-MMM-yyyy"))); - } else { - date_placed[0] = '\0'; + date_placed = waypointp->GetCreationTime().toString("dd-MMM-yyyy"); } writer->writeTextElement("styleUrl", "#geocache"); -- 2.30.2